home *** CD-ROM | disk | FTP | other *** search
/ Win '95 Giga Pack / Win95 Giga Pack (Maple Media) (1997).iso / UTILITY / WNBT32 / WWW95.WI_ < prev    next >
Text File  |  1996-03-13  |  25KB  |  659 lines

  1. ; WWWMENUS
  2. ; Common menus used by WWW Products
  3.  
  4.     CancelCmd="Exit"
  5.     goto %param1%        ; Go immediately to desired section
  6.                          ; Defined sections are:
  7.                               ZIP
  8.                               UNZIP
  9.                               SYSINFO
  10.                               INIEDIT
  11.                               FONEBOOK
  12.                               DIRSIZE
  13.                               FILEINFO
  14.                               FREESPACE
  15.                               FREESPACE2 (New Graphical version)
  16.                               CMDSTACK
  17.                               WALLPAPER
  18. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  19. :WALLPAPER
  20.            a=strcat(CurrentPath(),CurrentFile()) ; Is a BMP file hilited?
  21.            if FileExtension(a)=="BMP" then goto walldoit
  22.            a=FileItemize("*.bmp")                ; No?  Any in Current Directory?
  23.            if a!="" then goto sel
  24.  
  25.            ; Hmmm cannot find any BMP in current dir.  Check INI/Prompt user for info
  26.            WallDir1=inireadpvt("wallpaper","WallPaperDir","ASK","WWW-PROD.INI")
  27.            :REASK
  28.            if WallDir1=="ASK" then WallDir=AskLine("WallPaper","What directory are your *.BMP WallPaper files in?",DirWindows(0))
  29.                               else WallDir=WallDir1
  30.            ErrorMode(@off)
  31.            DirChange(WallDir)
  32.            ErrorMode(@cancel)
  33.            a=FileItemize("*.BMP")
  34.            if a=="" then Message("WallPaper Error","No *.BMP files found in %WallDir%")
  35.                     then goto REASK
  36.            if WallDir!=WallDir1 then iniwritepvt("wallpaper","WallPaperDir",WallDir,"WWW-PROD.INI")
  37.  
  38.            :sel
  39.            a=strcat("-None- ",a)
  40.            a=ItemSelect("Select New Wallpaper",a," ")
  41.            terminate(a=="","Wallpaper","No wallpaper selected")
  42.            if a=="-None-" then Wallpaper("",0)
  43.                           then exit
  44.            a=strcat(DirGet(),a)
  45.            :walldoit
  46.            tile=@FALSE
  47.            if FileSize(a)<40000 then tile=@TRUE
  48.            ;if bmp size less than 40K, assume tile, else center
  49.            Wallpaper(a,tile)
  50.            drop(a,b,tile)
  51.            Exit
  52. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  53. :CMDSTACK
  54.         ; CmdStack uses wierd variable names to reduce the chance that a user
  55.         ; will try to execute a statement using the same names!!
  56.         if !IsDefined(CMDSTK987Cmds) Then CMDSTK987Cmds=""
  57.         if !IsDefined(CMDSTK987Last) Then CMDSTK987Last="1+2+3"
  58.         goto %param2%
  59.  
  60.    :PREVIOUS
  61.         If CMDSTK987Cmds == "" Then Goto NEWCMD
  62.         CMDSTK987Now = TextSelect("Select a command, or OK to enter a new command", CMDSTK987Cmds, @tab)
  63.         If CMDSTK987Now != "" Then Goto CMDDOIT
  64.    :NEWCMD
  65.         CMDSTK987Now = AskLine("WIL Interactive", "Command to execute:", CMDSTK987Last)
  66.         If CMDSTK987Now == "" Then Goto PREVIOUS
  67.    :CMDDOIT
  68.         Execute Message(CMDSTK987Now, %CMDSTK987Now%)
  69.         if ItemLocate(CMDSTK987Now,CMDSTK987Cmds,@tab) then goto PREVIOUS
  70.         a=@tab
  71.         if CMDSTK987Cmds=="" then a=""
  72.         CMDSTK987Cmds = StrCat(CMDSTK987Cmds, a, CMDSTK987Now)
  73.         CMDSTK987Last = CMDSTK987Now
  74.         Goto PREVIOUS
  75.  
  76.    :FLUSH
  77.       If AskYesNo("Flush WIL command stack", "Really?") Then CMDSTK987Cmds = ""
  78.       Exit
  79. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  80. :FREESPACE
  81.         Drives=DiskScan(2)     ; 2 is the code for local hard drives
  82.         Dmax=strlen(Drives)
  83.         DIndex=1
  84.         TotalSize=0
  85.         DriveReport=""
  86.         madmax=0
  87.         :COUNTSPACE
  88.         NextDrive=StrSub(Drives,Dindex,1)
  89.         a=DiskFree(NextDrive)/1024
  90.         TotalSize=a+TotalSize
  91.         DriveReport=strcat(DriveReport,NextDrive," = ",@tab,a,"K","@")
  92.         DIndex=Dindex+3  ;each entry is 3 bytes long
  93.         if DIndex<=Dmax then goto COUNTSPACE
  94.         ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@")
  95.         Drop(TotalSize,DriveReport,Drives,NextDrive)
  96.         Exit
  97. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  98. :FREESPACE2
  99.  
  100. inifile="www-prod.ini"
  101. inisection="DskSpace"
  102. Sort=inireadpvt(inisection,"Sort",1,inifile)  
  103. LTGRAY="192,192,192"  
  104. GRAY="128,128,128"  
  105. DKGRAY="64,64,64"  
  106. GREEN="0,255,0"  
  107. PURPLE="255,0,255"  
  108. BLACK="0,0,0"  
  109. WHITE="255,255,255"  
  110. if WinMetrics(-4)==5 then D3COLOR=RegQueryValue(@REGCURRENT,"Control Panel\colors[ButtonFace]")
  111. IntControl(28,@tab,0,0,0) ;Standardize on tabs so code runs in 16 and 32 bit  
  112. BoxesUp("100,100,900,900",@Normal)  
  113. Boxcolor(1,"192,192,192",4)  
  114. boxdrawrect(1,"0,0,1000,1000",1)
  115. Noteid=4  
  116. rectNote="50,850,500,900"  
  117. BoxNew(Noteid,rectNote,1)  
  118. BoxButtonDraw(1,1,"Alphabet","50,920,190,970")  
  119. BoxButtonDraw(1,2,"FreeSpace","210,920,340,970")  
  120. BoxButtonDraw(1,3,"TotalSize","360,920,500,970")  
  121. BoxButtonDraw(1,4,"Exit","800,850,950,970")
  122. NoteHeight=400  
  123. rectNoteText="50,200,950,800"  
  124. rectnoteline1="0,0,1000,0"  
  125. rectNoteline2="1000,1000,1000,0"  
  126. rectNoteLine3="0,1000,1000,1000"  
  127. rectNoteLine4="0,0,0,1000"  
  128. notepenwidth=20  
  129. rectnoteline1b="40,150,960,150"  
  130. rectNoteline2b="960,840,960,150"  
  131. rectNoteLine3b="40,840,960,840"  
  132. rectNoteLine4b="40,150,40,840"  
  133. notepenwidthb=10  
  134. BoxColor(Noteid,D3COLOR,0)         
  135. BoxDrawRect(Noteid,"",2)  
  136. BoxPen(Noteid,WHITE,notepenwidth)  
  137. boxdrawline(Noteid,rectNoteLine1)  
  138. boxdrawline(Noteid,rectNoteLine4)  
  139. BoxPen(Noteid,GRAY,notepenwidth)  
  140. boxdrawline(Noteid,rectNoteLine2)  
  141. boxdrawline(Noteid,rectNoteLine3)  
  142. BoxPen(Noteid,WHITE,notepenwidthb)  
  143. boxdrawline(Noteid,rectNoteLine2b)  
  144. boxdrawline(Noteid,rectNoteLine3b)  
  145. BoxPen(Noteid,GRAY,notepenwidthb)  
  146. boxdrawline(Noteid,rectNoteLine1b)  
  147. boxdrawline(Noteid,rectNoteLine4b)  
  148. BoxDrawText(Noteid,rectNoteText,"SORT BY:",1,5)  
  149. BoxColor(1,D3COLOR,0)  
  150. BoxDrawRect(1,"550,850,759,970",1)  
  151. BoxTextColor(1,BLACK)  
  152. BoxDrawText(1,"550,850,759,970","All measurements are in Megabytes",1,21)  
  153. BoxDataTag(1,"FRED")
  154.  
  155.    
  156. while @true 
  157.         ;debug(1)
  158.         decimals(0)  
  159.         Drives=Diskscan(6)  
  160.         NumOfDrvs=ItemCount(Drives,@tab)  
  161.         matrix=binaryalloc(NumOfDrvs*24)  
  162.         
  163.         for DIndex=1 to NumOfDrvs   
  164.                  Drv=ItemExtract(DIndex,Drives,@tab)
  165.                  Drv=StrReplace(Drv,":","")  
  166.                  f=(DiskFree(Drv)/1048576)  
  167.                  s=(DiskSize(Drv)/1048576)  
  168.                  binarypokestr (matrix,(DIndex-1)*24,Drv)  
  169.                  binarypokeflt(matrix,(DIndex-1)*24+8,f)  
  170.                  binarypokeflt(matrix,(DIndex-1)*24+16,s)  
  171.         next  
  172.            
  173.         binarysort(matrix,24,16,8,@descending|@float8)  
  174.         biggest=binarypeekflt(matrix,16)  
  175.         switch sort       ;(alphabet =1 Freespace=2 Totalsize=3)  
  176.                 case 1  
  177.                  binarysort(matrix,24,0,8,@ascending|@float8)  
  178.                  Break  
  179.                 case 2  
  180.                  binarysort(matrix,24,7,8,@descending|@float8)  
  181.                  Break  
  182.                 case 3  
  183.                  binarysort(matrix,24,16,8,@descending|@float8)  
  184.                  Break  
  185.         EndSwitch  
  186.         If NumOfDrvs>6   
  187.                 mult=350/biggest  
  188.                 Vert=60  
  189.                 Thick=25  
  190.         else  
  191.                 mult=850/biggest  
  192.                 tTab=50  
  193.                 Vert=120  
  194.                 Thick=50  
  195.         endif  
  196.         ;Debug(1)  
  197.         for ai= 1 to min(NumOfDrvs,26)  
  198.                
  199.              if ai>13  
  200.                   a=ai-13   
  201.                   tTab=520  
  202.              else  
  203.                   a=ai  
  204.                   tTab=50  
  205.              endif  
  206.                   
  207.                 ;       Size  
  208.                 size=binarypeekflt(matrix,(ai*24)-8)  
  209.                 Boxcolor (1,PURPLE,0)  
  210.                 Muscle=strcat(tTab,",",a*Vert,",",(size*mult)+tTab,",",(a*Vert)+Thick)  
  211.                 BoxDrawRect(1,muscle,1)  
  212.                 boxtextcolor(1,PURPLE)  
  213.                 sinew=strcat((size*mult)+tTab,",",(a*vert),",",(size*mult)+tTab,",",(a*vert)+thick)   
  214.                 boxdrawtext(1,sinew,"%size% total",@false,0)  
  215.                 ;       Free  
  216.                 free=binarypeekflt(matrix,(ai*24)-16)  
  217.                 Boxcolor (1,GREEN,0)  
  218.                 bone=strcat(tTab,",",a*Vert,",",(free*mult)+tTab,",",(a*Vert)+Thick)  
  219.                 BoxDrawRect(1,bone,1)  
  220.                 marrow=strcat(tTab,",",(a*vert)+Thick+30,",",(size*mult)+tTab,",",(a*vert)+thick)   
  221.                 boxtextcolor(1,GREEN)  
  222.                 boxdrawtext(1,marrow,"%free% free",@false,0)  
  223.                 ;        Name  
  224.                 name=binarypeekstr (matrix,(ai*24)-24,1)  
  225.                 sinew=strcat(tTab-30,",",a*Vert,",",tTab,",",a*(Vert+Thick))  
  226.                 boxtextcolor(1,D3COLOR)  
  227.                 boxdrawtext(1,sinew,"%name%:",@false,0)  
  228.           
  229.         next ai
  230.         ; debug(1)  
  231.         BoxButtonWait()  
  232.         if BoxButtonStat(1,4)==1 then break
  233.         If BoxButtonStat(1,1)==1 then sort=1  
  234.         If BoxButtonStat(1,2)==1 then sort=2  
  235.         If BoxButtonStat(1,3)==1 then sort=3
  236.         BoxDataClear(1,"FRED")  
  237.         BoxUpdates(1,3) 
  238. end while
  239. iniwritepvt(inisection,"Sort",Sort,inifile)
  240. exit  
  241.  
  242.  
  243. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  244. :FILEINFO
  245.         CancelCmd="goto cancelfi"
  246.         a=FileItemize("")
  247.         if a=="" then a=FileItemize("*.*")
  248.         tot=FileSize(a)
  249.         c=ItemCount(a," ")
  250.         n=0
  251.         b=""
  252.         :ffloop
  253.         if n==c then goto ffshow
  254.         n=n+1
  255.         a1=StrFix(ItemExtract(n,a," ")," ",14)
  256.         a2=FileSize(a1)
  257.         a3=FileTimeGet(a1)
  258.         a4=FileAttrGet(a1)
  259.         b=strcat(b,a1,@tab,a2,@tab,a3,@tab,a4,"|")
  260.         goto ffloop
  261.         :ffshow
  262.         ItemSelect("Total Size=%tot%",b,"|")
  263.         :cancelfi
  264.         drop(a,tot,c,n,a1,a2,a3,a4,b)
  265.         Exit
  266. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  267. :DIRSIZE
  268.         tot = FileSize(FileItemize(""))
  269.         sub1 = DirItemize("")
  270.         if (tot==0 && sub1=="") then tot=FileSize(FileItemize("*.*"))
  271.                                 then sub1=DirItemize("*.*")
  272.         totdir=0
  273.         level=1
  274.         dir1=DirGet()
  275.         numdir1 = ItemCount(sub1, " ")
  276.         index1 = 0
  277.   
  278.         :dsloop
  279.         If index%level% == numdir%level% Then Goto upalevel
  280.         index%level% = index%level% + 1
  281.         DirChange(StrCat(dir%level%, ItemExtract(index%level%, sub%level%, " ")))
  282.         totdir=totdir+1
  283.         tot = tot + FileSize(FileItemize("*.*"))
  284.         level = level + 1
  285.         dir%level% = DirGet()
  286.         sub%level% = DirItemize("*.*")
  287.         numdir%level% = ItemCount(sub%level%, " ")
  288.         index%level% = 0
  289.         goto dsloop
  290.   
  291.         :upalevel
  292.         drop(dir%level%,sub%level%,index%level%,numdir%level%)
  293.         level=level-1
  294.         if level!=0 then goto dsloop
  295.  
  296.         ; -----------
  297.         ; Termination
  298.         ; -----------
  299.         If StrLen(tot) < 9 Then tot = StrCat(StrFill("", 9 - StrLen(tot)), tot)
  300.         tot = StrCat(StrSub(tot,1,3),",",StrSub(tot,4,3),",",StrSub(tot,7,3))
  301.         tot = StrTrim(tot)
  302.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  303.         tot = StrTrim(tot)
  304.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  305.         tot = StrTrim(tot)
  306.         Message("%totdir% Subdirectories included", "Total size %tot% bytes.")
  307.         drop(tot,level,totdir)
  308.         Exit
  309.  
  310. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  311. :SYSINFO
  312.        wintype="retail"
  313.        if WinMetrics(22) then wintype="debug"
  314.         wcx=WinMetrics(-3)
  315.         math="Math"
  316.         switch wcx
  317.            case 0   ; Win16
  318.                 wc=WinConfig()
  319.                 if !(wc&1) then mode="Real"
  320.                 if wc&16 then mode="Standard"
  321.                 if wc&32 then mode="Enhanced"
  322.                 
  323.                 if wc&64 then cpu=8086
  324.                 if wc&128 then cpu=80186
  325.                 if wc&2 then cpu=286
  326.                 if wc&4 then cpu=386
  327.                 if wc&8 then cpu=486
  328.                 mode = strcat(mode,' ',wintype,' Windows ')
  329.                 if !(wc&1024)  then math="No math"
  330.                 break
  331.           case 1 ; Win32 Intel
  332.                mode="Intel 32-bit %wintype% Windows "
  333.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  334.                break
  335.           case 2 ; Dec Alpha
  336.                mode="DEC Alpha %wintype% Windows NT "
  337.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  338.                break
  339.           case 3 ; MIPS
  340.                mode="MIPS %wintype% Windows NT "
  341.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  342.                break
  343.           case 4 ; PowerPC 
  344.                mode="PowerPC %wintype% Windows NT "
  345.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  346.                break
  347.           case wcx
  348.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  349.                mode="Unknown platform %wintype% Windows  "
  350.         endswitch
  351.  
  352.         Sysinfo=strcat(cpu,' ',mode,WinVersion(1),'.',WinVersion(0),@CRLF)
  353.  
  354.         mouse="No Mouse"
  355.         if WinMetrics(19) then mouse="Mouse"
  356.  
  357.         Sysinfo=strcat(sysinfo,math," co-processor.   ",mouse,' available.',@CRLF)
  358.  
  359.         sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution.  ",WinMetrics(-1),"  colors.",@CRLF)
  360.  
  361.         ErrorMode(@OFF)
  362.         LastError()
  363.         PlayMedia("Status WaveForm Ready")
  364.         ErrorMode(@CANCEL)
  365.         if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",@CRLF)
  366.         a=NetInfo(0)
  367.         if a=="MULTINET"
  368.              b=NetInfo(1)
  369.              bug=strcat(b,"network(s) installed"))
  370.              ;Message("Multinet supporting  %count% networks", b)
  371.         else
  372.              ;Message("Installed Network", a)
  373.              bug=strcat(a," network installed")
  374.         endif
  375.         sysinfo=strcat(sysinfo,bug,@crlf)
  376.  
  377.  
  378.         switch wcx
  379.            case 0
  380.                bug=WinResources(0)/1024   ; Compute memory avail
  381.                math=strlen(bug)
  382.                if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3))
  383.                sysinfo=strcat(sysinfo,@crlf,bug," KB Free Memory",@crlf)
  384.                sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",@crlf)
  385.               break
  386.            case wcx
  387.               bug=WinResources(11)/1024   ; Get Physical memory avail
  388.               sysinfo=strcat(sysinfo,@crlf,bug," KB Physical Memory",@crlf)
  389.               bug=(WinResources(14)/1024)+bug   ; Get Virtual memory + Physical avail
  390.               sysinfo=strcat(sysinfo,bug," KB Total Memory",@crlf)
  391.         end switch
  392.  
  393.  
  394.         sysinfo=strcat(sysinfo,"Console ",DosVersion(1),'.',DosVersion(0),"  using ",environment("COMSPEC"),@CRLF)
  395.         disks=DiskScan(1)
  396.         disks=StrReplace(disks,@tab," ")
  397.         if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,@CRLF)
  398.         disks=DiskScan(2)
  399.         disks=StrReplace(disks,@tab," ")
  400.         if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,@CRLF)
  401.         disks=DiskScan(4)
  402.         disks=StrReplace(disks,@tab," ")
  403.         if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,@CRLF)
  404.         sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),@CRLF)
  405.         sysinfo=strcat(sysinfo,"System  Directory ",DirWindows(1),@CRLF)
  406.         sysinfo=strcat(sysinfo,@CRLF,"WIL Interpreter Ver ",VersionDll())
  407.  
  408.         ver=Version()
  409.         Message("%Param2% %ver% SysInfo",Sysinfo)
  410.         Exit
  411.  
  412. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  413. :ZIP
  414. :UNZIP
  415.     debug(1)
  416.     CancelCommand="goto ZZCANCEL"
  417.     ErrMsg=""
  418.     If !FileExist("wwwdos.bat")   Then ErrMsg="WWWDOS.BAT   not found"
  419.     If !FileExist("wwwdosp.pif")  Then ErrMsg="WWWDOSP.PIF  not found"
  420.     If !FileExist("wwwdosc.pif")  Then ErrMsg="WWWDOSC.PIF  not found"
  421.     If !FileExist("wwwzipls.exe") Then ErrMsg="WWWZIPLS.EXE not found"
  422.     If !FileExist("pkzip.exe")    Then ErrMsg="PKZIP.EXE    not found"
  423.     If !FileExist("pkunzip.exe")  Then ErrMsg="PKUNZIP.EXE  not found"
  424.     If !FileExist("%FCDir789672%browser.exe")  Then ErrMsg="%FCDir789672%BROWSER.EXE  not found"
  425.     If ErrMsg!="" Then Goto ShowError
  426.  
  427.         goto %param1%2     ; must be ZIP or UNZIP
  428.  
  429. :ZIP2
  430.         DaMove=" -a "
  431.         DaDirs=""
  432.         DaWho="*.*"
  433.         DaZip=""
  434.         DaRefresh=0
  435.         DaTitle="Files"
  436.         param3=strlower(param3)
  437.         if param3=="move" then DaMove=" -m "
  438.         goto %param2%         ; Must be CURRENT, DIR, SUBDIR, or HILITED
  439.  
  440. :CURRENT
  441.         DaWho=strcat(CurrentPath(),CurrentFile())
  442.         DaZip=strcat(FileRoot(DaWho),".ZIP")
  443.         goto ZIPDO
  444. :SUBDIR
  445.        DaDirs=" -r -p "
  446.        DaRefresh=1
  447.        DaTitle="Structure"
  448.        goto ZIPDO
  449.  
  450. :HILITED
  451.         b=FileItemize("")
  452.         If b=="" Then ErrMsg="Zip Hilited files?  No files hilited!"
  453.                  Then Goto ShowError
  454.         b=strreplace(b," ",@CRLF)
  455.         fp=FileOpen("FC-TEMP9.XCV","WRITE")
  456.         FileWrite(fp,b)
  457.         FileClose(fp)
  458.         Drop(b)
  459.         DaWho="@FC-TEMP9.XCV"
  460.         goto ZIPDO
  461.  
  462. :DIR
  463.        DaTitle="Directory"
  464.        goto ZIPDO
  465.  
  466. :ZIPDO
  467.         DaZip=AskLine("Zip %DaTitle%","Enter desired ZIP name",DaZip)
  468.         if DaZip=="" then goto zzcancel
  469.         Runwait("wwwdosc.pif","pkzip.exe %DaMove% %DaDirs% %DaZip% %DaWho%")
  470.         if DaWho=="FC-TEMP9.XCV" then FileDelete(DaWho)
  471.         Refresh(DaRefresh)
  472.         Display(3,"Zip %DaTitle%","Complete")
  473.         goto zzcancel
  474.  
  475. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  476. :UNZIP2
  477.  
  478.        ViewFlag=0
  479.        zipsort=param3
  480.        goto %param2%    ; must be ALL, VIEW, or INDIV
  481.  
  482. :ALL
  483.         zipfile=strcat(CurrentPath(),CurrentFile())
  484.         if FileExtension(zipfile)=="ZIP" then goto alldoit
  485.         zipfile=FileItemize("*.zip")
  486.         If zipfile=="" Then ErrMsg="UnZip files?  No zip files found!"
  487.                  Then Goto ShowError
  488.         zipfile=itemselect("Select file to UnZip",zipfile," ")
  489.         if zipfile=="" then goto zzcancel
  490. :alldoit
  491.         if param3==2 then goto allspec
  492.         runwait("wwwdosc.pif","pkunzip.exe -d %zipfile%")
  493.         Refresh(1)
  494.         goto zzcancel
  495.  
  496. :allspec
  497.         RetHome="allspec1"
  498.         goto DoOptions
  499. :allspec1
  500.         if overwarn==0 then overwarn=" -o "
  501.                        else overwarn=""
  502.         RunWait("wwwdosc.pif", "pkunzip.exe -d %overwarn% %zipfile% %targdir% *.*")
  503.         Refresh(1)
  504.         goto zzcancel
  505.  
  506.  
  507.  
  508. :INDIV
  509.        ViewFlag=param3
  510.        if ViewFlag==1 then zipsort=1
  511.                       then overwarn=0
  512.                       then targdir=""
  513.                       then goto VIEW
  514.  
  515.         RetHome="VIEW"
  516.         goto DoOptions
  517.  
  518. :VIEW
  519.         workdir = Environment("TEMP")
  520.         If workdir == "" Then workdir = DirWindows(0)
  521.         If StrSub(workdir, StrLen(workdir), 1) != "\" Then workdir = StrCat(workdir, "\")
  522.         if ViewFlag==0 then targdir=workdir
  523.         zipfile=strcat(CurrentPath(),CurrentFile())
  524.         if FileExtension(zipfile)=="ZIP" then goto viewdoit
  525.         zipfile=FileItemize("*.zip")
  526.         If zipfile=="" Then ErrMsg="UnZip files?  No zip files found!"
  527.                  Then Goto ShowError
  528.         if ViewFlag==0 then TSMsg="Select ZIP file to view"
  529.                        else TSMsg="Select ZIP file to use"
  530.         zipfile=itemselect(TSMsg,zipfile," ")
  531.         if zipfile=="" then goto zzcancel
  532.  
  533. :viewdoit
  534.         ziplist = StrCat(workdir, "wwwunzip.lst")
  535.         If FileExist(ziplist) Then FileDelete(ziplist)
  536.  
  537.         RunWait("wwwzipls.exe","%zipfile% %ziplist% %zipsort%")
  538.         if ViewFlag==0 then TSMsg="Select file to view"
  539.                        else TSMsg="Select file to extract"
  540. :TXSEL
  541.         OldFont=IntControl(28,1,0,0,0)        ; Set fixed pitch font in text box
  542.         member=TextBox(TSMsg,ziplist)
  543.         IntControl(28,OldFont,0,0,0)          ; Restore previous font pitch type
  544.         if member=="" then goto ZZCANCEL
  545.  
  546.         member=strsub(member,46,strlen(member)-45)
  547.         memfile=FileExtension(member)
  548.         if memfile!="" then memfile=strcat(FileRoot(member),".",memfile)
  549.                        else memfile=FileRoot(member)
  550.         
  551.  
  552.         if ViewFlag==0 then goto extract
  553.         if overwarn==0 then goto extract
  554.         If FileExist("%targdir%%memfile%") == @FALSE Then Goto extract
  555.         b= AskYesNo("%member% already exists in %targdir%", "Do you wish to replace it?")
  556.         If b == @NO Then Goto TXSEL
  557.  
  558. :extract
  559.         RunWait("wwwdosc.pif", "pkunzip.exe -o %zipfile% %targdir% %member%")
  560.         If !FileExist("%targdir%%memfile%") Then ErrMsg="Problem extracting %member% from ZIP file"
  561.                                            Then Goto ShowError
  562.  
  563.         if ViewFlag!=0 then TSMsg="Extract Another?"
  564.                        then goto TXSEL
  565.         member = StrUpper(StrCat(targdir, memfile))
  566.         RunZoomWait("%FCDir789672%browser.exe", member)
  567.         FileDelete(member)
  568.         TSMsg="View Another?"
  569.         goto TXSEL
  570.  
  571.  
  572. :SHOWERROR
  573.     Message("Error", ErrMsg)
  574.  
  575. :ZZCANCEL
  576.     if IsDefined(ziplist) then If FileExist(ziplist) Then FileDelete(ziplist)
  577.     Drop(DaMove,DaDirs,DaWho,DaZip,DaRefresh,DaTitle,ViewFlag,zipsort)
  578.     Drop(zipfile,b,RetHome,overwarn,targdir,workdir,ziplist,TSMsg,member)
  579.     Drop(ErrMsg,usecurdir,ThisDir,CheckDir,memfile)
  580.     Drop(ZippyFormat,ZippyCaption,ZippyX,ZippyY,ZippyWidth,ZippyHeight)
  581.     Drop(ZippyNumControls,Zippy01,Zippy02,Zippy03,Zippy04,Zippy05,Zippy06)
  582.     Drop(Zippy07,Zippy08,Zippy09,Zippy10,Zippy11,Zippy12,Zippy13)
  583.     exit
  584. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  585.  
  586. :DOOPTIONS
  587.         zipsort = IniReadPvt("WWWUNZIP", "SortOrder", 1, "www-prod.ini")
  588.         overwarn=IniReadPvt("WWWUNZIP","OverWarn",1,"www-prod.ini")
  589.         whichdir=IniReadPvt("WWWUNZIP","WhichDir",1,"www-prod.ini")
  590.  
  591.         ; Undocumented, new, beta dialog function being used here.  Will
  592.         ; be documented in the 2.0 release.  Good Luck.
  593.  
  594.  
  595.         ZippyFormat=`WWWDLGED,4.0`
  596.  
  597.         ZippyCaption=`Zip Options`
  598.         ZippyX=-1
  599.         ZippyY=-1
  600.         ZippyWidth=217
  601.         ZippyHeight=115
  602.         ZippyNumControls=13
  603.         Zippy01=`6,18,80,DEFAULT,RADIOBUTTON,whichdir,"Use Current Dir ->",1`
  604.         Zippy02=`6,32,80,DEFAULT,RADIOBUTTON,whichdir,"Use Specified Dir ->",2`
  605.         Zippy03=`86,32,124,DEFAULT,EDITBOX,targdir,""`
  606.         Zippy04=`16,64,56,DEFAULT,RADIOBUTTON,zipsort,"by Name",1`
  607.         Zippy05=`16,76,58,DEFAULT,RADIOBUTTON,zipsort,"by Extension",2`
  608.         Zippy06=`16,88,46,DEFAULT,RADIOBUTTON,zipsort,"by Date",3`
  609.         Zippy07=`16,100,46,DEFAULT,RADIOBUTTON,zipsort,"by Size",4`
  610.         Zippy08=`108,58,80,DEFAULT,CHECKBOX,overwarn,"Warn on Overwrite",1`
  611.  
  612.         Zippy09=`120,78,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1`
  613.         Zippy10=`120,98,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",0`
  614.         Zippy11=`6,4,64,DEFAULT,STATICTEXT,NONAME,"Target Directory"`
  615.         Zippy12=`6,52,64,DEFAULT,STATICTEXT,NONAME,"Sort list by:"`
  616.         Zippy13=`88,20,122,DEFAULT,VARYTEXT,ThisDir,""`
  617.  
  618.  
  619. :gettarg
  620.         ; Undocumented, new, beta dialog function being used here.  Will
  621.         ; be documented in the 2.0 release.  Good Luck.
  622.         ThisDir=DirGet()
  623.         targdir = IniReadPvt("WWWUNZIP", "TargetDir", DirGet(), "www-prod.ini")
  624.         Dialog("Zippy")
  625.  
  626.         if whichdir==1 then usecurdir = @YES
  627.                        then targdir=ThisDir
  628.                        else usecurdir = @NO
  629.         targdir = StrUpper(targdir)
  630.         If targdir == "" Then usecurdir = @YES
  631.                          Then targdir = DirGet()
  632.         If StrSub(targdir, StrLen(targdir), 1) != "\" Then targdir = StrCat(targdir, "\")
  633.         If ThisDir==targdir then usecurdir = @YES
  634.                             then goto targok
  635.         DirChange(targdir)
  636.         CheckDir=DirGet()
  637.         DirChange(ThisDir)
  638.         If ThisDir!=CheckDir Then Goto targok
  639.  
  640.         b= AskYesNo("WWWUNZIP", "%targdir% does not exist.  Do you wish to create it?")
  641.         If b == @NO Then Goto gettarg
  642.         DirMake(targdir)
  643.         DirChange(targdir)
  644.         CheckDir=DirGet()
  645.         DirChange(ThisDir)
  646.         If ThisDir!=CheckDir Then Goto targok
  647.         Message("WWWUNZIP","%targdir% could not be created.  Please respecify.")
  648.         goto gettarg
  649.  
  650.         :targok
  651.         If usecurdir == @NO Then IniWritePvt("WWWUNZIP", "TargetDir", targdir, "www-prod.ini")
  652.         IniWritePvt("WWWUNZIP", "SortOrder", zipsort, "www-prod.ini")
  653.         IniWritePvt("WWWUNZIP", "OverWarn", overwarn, "www-prod.ini")
  654.         IniWritePvt("WWWUNZIP", "WhichDir", whichdir, "www-prod.ini")
  655.         goto %RetHome%
  656. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  657. :CANCEL        ; This cancel is shared by ALL the above routines.
  658. %CancelCmd%    ; Execute Cancel Command
  659.